import request from '@/utils/request'

// 查询参数列表
export function list(query) {
  return request({
    url: '/api/system/category/list',
    method: 'get',
    params: query
  })
}

// 查询菜单下拉树结构
export function treeselect() {
  return request({
    url: '/api/system/category/treeselect',
    method: 'get'
  })
}
// 查询菜单下拉树结构
export function selectByTitle(categoryTitle) {
  return request({
    url: '/api/system/category/selectByTitle/'+ categoryTitle,
    method: 'get'
  })
}


//
export function add(data) {
  return request({
    url: '/api/system/category/add',
    method: 'post',
    data:data
  })
}
//
export function update(data) {
  return request({
    url: '/api/system/category/update',
    method: 'post',
    data:data
  })
}

// 删除栏目
export function delDept(id) {
  return request({
    url: '/api/system/category/remove/' + id,
    method: 'delete'
  })
}
// 查询栏目详细
export function getDept(id) {
  return request({
    url: '/api/system/category/' + id,
    method: 'get'
  })
}

// 获取栏目选择框列表
export function optionselect() {
  return request({
    url: '/api/system/category/select',
    method: 'get'
  })
}
